home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: jhewett@ix.netcom.com (Jerry Hewett)
- Newsgroups: comp.lang.c++
- Subject: Re: Begging for help! Desperate!
- Date: Sat, 06 Apr 96 18:13:12 GMT
- Organization: Netcom
- Message-ID: <N.040696.101312.44@ix.netcom.com>
- References: <4k4il4$ccr@cronkite.seas.gwu.edu>
- NNTP-Posting-Host: tem-ca1-18.ix.netcom.com
- X-NETCOM-Date: Sat Apr 06 12:11:25 PM CST 1996
- X-Newsreader: Quarterdeck Message Center [2.00]
-
- Karim P. Draoui <kelly@seas.gwu.edu> asks:
-
- > I am trying to close a window in a program I am creating in Borland C++ 4.5.
- > Basically what I am trying to do is open another window and close the current
- > window. I am having problems though using the CloseWindow function. I am
- > able to open another window, but I cannot close the current window. I have
- > used the books that come with Borland, but with no luck. Anyways, if anyone
- > can help me out as soon as possible I would really appreciate it.
-
- If I could look at your code I might be able to help you out with this. At
- this point I'm guessing that the windows in question are child windows and not
- the parent window for your application (which would explain why things aren't
- quite working right :-). If so, try trapping on the WM_CLOSE case in your
- WinProc and sending out a DestroyWindow command. You'll still need to send the
- WM_CLOSE message to your window, though:
-
- SendMessage (handle_to_your_first_window,WM_CLOSE,0,0);
- .
- .
- .
- case WM_CLOSE:
- DestroyWindow (handle_to_your_first_window);
- handle_to_your_first_window = 0;
- break;
-
- Depending on how your program is put together, there might be a bit more
- involved with destroying the first window.
-
- Advice that I consistantly offer to folks that want to write Windows apps --
- buy a copy of _Programming Windows_ by Charles Petzold (Microsoft Press). It's
- still the best intro and general reference available for Windows developers.
-
- Jerry H.
-
-
-